package main

import (
	"fmt"
	"github.com/spf13/viper"
)

func jsonconfig() {

	if err := viper.ReadInConfig(); err != nil {
		fmt.Printf("Error reading config file, %s \n", err)
	}
	var ser = viper.Sub("compilerOptions.modules")
	newModules := Modules{}
	err := ser.Unmarshal(&newModules)
	fmt.Println("=============", newModules.Name, err)
}

type Modules struct {
	Age  int    `json:"age"`
	Name string `json:"name"`
}
